package com.cet.designpatterns.state.mytest;

/**
 * 测试类
 */
public class Client {
    public static void main(String[] args) {
        //创建业务对象，设置数据
        LeaveRequestModel model=new LeaveRequestModel();
        model.setUser("鸟鹏");
        model.setDateBegin("20180930");
        //model.setLeaveDays(1);
        model.setLeaveDays(4);

        LeaveRequestContext context=new LeaveRequestContext();
        context.setBusinessObj(model);
        //配置上下文的初始状态，以后就随流程而动态变化（状态驱动）
        context.setState(new ProjectManagerState());
        context.doWork();
    }
}
